package com.seveneight.baijiesteward.utils;

import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;

import com.github.jdsjlzx.ItemDecoration.DividerDecoration;
import com.github.jdsjlzx.recyclerview.LRecyclerView;
import com.seveneight.baijiesteward.R;

/**
 * Created by user1 on 2018/2/8.
 */

public class RecyclerviewInitUtil {

    public static void initFirstRecycler(Context context, LRecyclerView recyclerView) {
        GridLayoutManager manager = new GridLayoutManager(context, 4);
        recyclerView.setLayoutManager(manager);
        recyclerView.setPullRefreshEnabled(false);
        recyclerView.setHasFixedSize(true);
    }

    public static void initRefreshLinearReccycler(Context context, LRecyclerView recyclerView,int dividerPadding){
        LinearLayoutManager manager=new LinearLayoutManager(context);
        DividerDecoration divider = new DividerDecoration.Builder(context)
                .setHeight(dividerPadding)
                .setColorResource(R.color.view_bg)
                .build();
        recyclerView.setLayoutManager(manager);
        recyclerView.addItemDecoration(divider);
    }

    public static void initLineRecycler(Context context, LRecyclerView recyclerView) {
        LinearLayoutManager manager=new LinearLayoutManager(context);
        recyclerView.setLayoutManager(manager);
        recyclerView.setHasFixedSize(true);
    }

}
